package com.gupao.study.design.simpleFactory;

import com.gupao.study.design.model.AmericanStyleBed;
import com.gupao.study.design.model.Bed;
import com.gupao.study.design.model.ChineseStyleBed;

/**
 * 简单工厂
 * @author xiaozhikun
 *
 */
public class FurnitureFactory {
	public static void main(String[] args) {
		System.out.println(new FurnitureFactory().product("Chinese").getName());
	}
	public Bed product(String style) {
		if("Chinese".equals(style)) {
			return new ChineseStyleBed();
		}else if("American".equals(style)) {
			return new AmericanStyleBed();
		}else {
			return null;
		}
	}
}
